-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ghc: update bootstrap 8.6.3 -> 8.6.5, add aarch64 support #83048
ghc: update bootstrap 8.6.3 -> 8.6.5, add aarch64 support #83048
Conversation
I meant to open this as a draft. |
@thefloweringash This seems reasonable. Is there any reason you've marked this as a WIP? Is there anything that is not currently working? @GrahamcOfBorg build ghc |
I'm not aware of anything not working. I built ghc, I'll see if I can build pandoc. I'll remove the WIP and DRAFT markers. There was some contention about the llvm input, see #80355 (review) and further comments. Now that I've seen the build count, this probably shouldn't go to master. Should this go to |
9769233
to
43a3e2a
Compare
It looks like Let's see if lens can be built as well: @GrahamcOfBorg build haskellPackages.lens @thefloweringash Okay, that sounds good. I think you're right, this should probably go to the After that, how about giving this 1 week for other people to review it, and if nobody has anything bad to say about it, I'll merge it in. Please ping me in 1 week if there has been no activity. Also, cc @matthewbauer and @Ericson2314, who occasionally contribute to the GHC derivation. |
}; | ||
}.${stdenv.hostPlatform.system} | ||
or (throw "cannot bootstrap GHC on this platform")); | ||
|
||
nativeBuildInputs = [ perl ]; | ||
propagatedBuildInputs = lib.optional stdenv.isAarch64 [ llvm ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the big question from #80355 (review) is, "Why is this needed?"
It seems strange that aarch64 would need this, but nothing else would. Additionally, why is this not needed for the non-bootstrap GHCs?
I don't really have any knowledge of how GHC is built, or how aarch64 works, but this just seems like the wrong solution.
If this is actually needed, then ideally there would be a comment on this line explaining it (and possibly linking to upstream GHC documentation justifying it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I have found the answers.
GHC on non-x86 uses the LLVM codegen by default [citation needed]. When using the LLVM codegen, ghc needs llvm binaries on the path.
You must install and have LLVM available on your
PATH
for the LLVM code generator to work. Specifically GHC needs to be able to call theopt
andllc
tools.
-- (from 10.10.2. LLVM Code Generator (-fllvm))
It seems strange that aarch64 would need this, but nothing else would. Additionally, why is this not needed for the non-bootstrap GHCs?
It turns out this is required for the non-bootstrap GHCs, and is already present in propagatedBuildInputs
of, for example, ghc 8.8.3:
nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
Lines 193 to 194 in bfb747a
propagatedBuildInputs = [ targetPackages.stdenv.cc ] | |
++ stdenv.lib.optional useLLVM llvmPackages.llvm; |
I've updated the branch to more closely resemble the non bootstrap GHC structure.
43a3e2a
to
da7cc27
Compare
1049812
to
902e436
Compare
902e436
to
731b879
Compare
@GrahamcOfBorg build ghc |
The effects of this change can be tracked in hydra evaluation 1576936. |
Well, down-side is that this jobset only uses |
Motivation for this change
GHC on Aarch64.
I'm not in the loop with how the haskell infrastructure works in nixpkgs, I just require ghc to build my system for things like pandoc and nix-diff. I assume aarch64 was omitted from ghc863Binary due to the upstream 8.6.3 release not to having an appropriate tarball. The upstream 8.6.5 release includes
ghc-8.6.5-aarch64-ubuntu18.04-linux.tar.xz
.With these changes, I can build ghc 8.8.3 on aarch64. I split out the commit for the version change and the aarch64 support to make it easier to read.
Related: #80355 -- contains the same llvm logic as here for
propagatedBuildInputs
Related: #80176 -- issue for this and #80355
cc @MarcWeber @kosmikus @peti (maintainers of ghc)
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)